/**
 * @description 入口页面。
 * 取一些参数，再跳转到对应装修页面
 */
import { useSearchParams } from "react-router-dom"
import router from "@/router";
import { useEffect } from "react";
export default function IndexPage() {

  const [params] = useSearchParams();
  let token = params.get('t')

  // let id = params.get('id') || 4613
  // let type = params.get('type') || 'front'
  // let year = params.get('year') || 2025

  let id = params.get('id') || 4610
  let type = params.get('type') || 'admin'
  let year = params.get('year') || 2026

  // Token
  if (token) {
    localStorage.setItem('Token', token)
  }

  // 标题
  let documentTitle = type == 'admin' ? 'React后台装修' : 'React前台装修'
  document.title = documentTitle


  useEffect(() => {
    router.navigate(`${year}/${type}?id=${id}`)
  }, [])

  return null
}